package com.se.hospitalmonitoring;

import java.io.Serializable;

/**
 * A wrapper around data that can be sent through an object stream. Keeps track
 * of the type of data to prevent casting exceptions
 */
public class Message implements Serializable {
	private static final long serialVersionUID = 1L;

	// The possible message types
	public static enum Type {
		Startup, Shutdown, VitalSignUpdate, CallNotification, AlarmNotification, CancelCall, CancelAlarm
	}

	public Type type = null;
	public Object value = null;
	public long bedId = -1L;

	/**
	 * Creates a new message
	 * 
	 * @param type
	 *            The type of message
	 * @param bedId
	 *            The bed id
	 * @param value
	 *            The object value of the message
	 */
	public Message(Type type, long bedId, Object value) {
		this.type = type;
		this.bedId = bedId;
		this.value = value;
	}
}
